#!/bin/bash -ex

_term() {
    echo "Caught SIGTERM signal, forward to child"
    kill -TERM "$child"
    exit 0
}

trap _term SIGTERM

python3 manage.py makemigrations application_flow
python3 manage.py migrate
python3 manage.py runserver --insecure 0.0.0.0:8000 &

child=$!
wait "$child"
